<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /*
        em
            em是相对于字体的大小来计算的
            1 em = 1 fontsize
            em会根据字体的大小改变
        rem
            rem是根据根元素（html）的字体大小来计算
        */
        html{
            font-size: 30px;
        }
        .box1{
            height:5rem;
            width: 10rem;
            background-color: red;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
</body>
</html>